/**
 * 
 */
package org.cuatrovientos.erp.model;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

public class Customer {

	@Min(value=1,message="{customer.id.error}")
	private int id;
	
	@NotNull(message="{customer.name.error}")
	private String name;
	
	@NotNull(message="{customer.adress.error}")
	private String adress;
	
	@Pattern(regexp="^\\(?(\\d{3})\\)?[- ]?(\\d{3})[- ]?(\\d{4})$", message="{customer.phone.error}")
	private String phone;
	
	@Size(min=1,max=100,message="{customer.email.error}")
	private String email;
	
	@Min(value=1,message="{customer.idCity.error}")
	private int idCity;

	/**
	 * Empty constructor
	 */
	public Customer() {
		super();
	}

	/**
	 * Constructor using fields
	 * @param id
	 * @param name
	 * @param adress
	 * @param phone
	 * @param email
	 * @param idCity
	 */
	public Customer(int id, String name, String adress, String phone,
			String email, int idCity) {
		super();
		this.id = id;
		this.name = name;
		this.adress = adress;
		this.phone = phone;
		this.email = email;
		this.idCity = idCity;
	}

	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the adress
	 */
	public String getAdress() {
		return adress;
	}

	/**
	 * @param adress the adress to set
	 */
	public void setAdress(String adress) {
		this.adress = adress;
	}

	/**
	 * @return the phone
	 */
	public String getPhone() {
		return phone;
	}

	/**
	 * @param phone the phone to set
	 */
	public void setPhone(String phone) {
		this.phone = phone;
	}

	/**
	 * @return the email
	 */
	public String getEmail() {
		return email;
	}

	/**
	 * @param email the email to set
	 */
	public void setEmail(String email) {
		this.email = email;
	}

	/**
	 * @return the idCity
	 */
	public int getIdCity() {
		return idCity;
	}

	/**
	 * @param idCity the idCity to set
	 */
	public void setIdCity(int idCity) {
		this.idCity = idCity;
	}
}
